<#list fisher.grid.columnList as column >
  <#if column.searchable=="true" && column.visual=="true" >
<#include "grid-filter.ftl"><#nt>
<#break>
  </#if>
</#list>  
<table id="${fisher.id}" style="display:none"></table>
<script type="text/javascript">
 <#include "grid-editer.ftl">
//Grid组装
 $("#${fisher.id}").flexigrid(
  {
   fishergrid:'${fisher.name}',
   height: ${fisher.height?default("'auto'")}, //default height
   width: ${fisher.width?default("'auto'")}, //auto width
   striped: ${fisher.striped?default("true")}, //apply odd even stripes
   novstripe: ${fisher.novstripe?default("false")},
   minwidth: ${fisher.minwidth?default("80")}, //min width of columns
   minheight: ${fisher.minheight?default("30")}, //min height of columns
   resizable: ${fisher.resizable?default("true")}, //resizable table
   url: '${fisher.getReqeustSearchURL(contextPath+fisher.url?default("/fisher/jsp/griddata.jsp"))?js_string}', //ajax url
   method: '${fisher.method?default("POST")?js_string}', // data sending method
   dataType: '${fisher.dataType?default("json")?js_string}', // type of data loaded
   errormsg: '${fisher.errormsg?default("连接错误")?js_string}',
   usepager: ${fisher.usepager?default("true")}, //
   nowrap: ${fisher.nowrap?default("true")}, //
   page: ${fisher.page?default("1")}, //current page
   total: ${fisher.total?default("1")}, //total pages
   useRp: ${fisher.useRp?default("true")}, //use the results per page select box
   rp: ${fisher.rp?default("10")}, // results per page
   rpOptions: ${fisher.rpOptions?default("[5,10,15,20,25,30,35,40]")},
   title: '${fisher.title?default("")?js_string}',
   pagestat: '${fisher.pagestat?default("显示 {from} - {to}&nbsp;&nbsp;&nbsp;&nbsp;共{total}条记录")?js_string}',
   procmsg: '${fisher.procmsg?default("正在处理中,请稍侯 ...")?js_string}',
   query: '${fisher.queryValue?default("")?js_string}',
   qtype: '${fisher.queryColumn?default("")?js_string}',
   dynamic: '${fisher.dynamicValue?default("")?js_string}',
   dtype: '${fisher.dynamicColumn?default("")?js_string}',   
   nomsg: '${fisher.nomsg?default("没有记录")?js_string}',
   minColToggle: ${fisher.minColToggle?default("1")}, //minimum allowed column to be hidden
   showToggleBtn: ${fisher.showToggleBtn?default("true")}, //show or hide column toggle popup
   hideOnSubmit: ${fisher.hideOnSubmit?default("true")},
   autoload: ${fisher.autoload?default("true")},
   blockOpacity: ${fisher.blockOpacity?default("0.5")},
   <#list fisher.grid.columnList as column ><#--设置默认查询字段-->
    <#if column.defaultSort=="true" >
   sortname: '${column.name}',
   sortorder: '${column.defaultSortOrder}',
   <#break>
   </#if>
   </#list>
   onToggleCol: ${fisher.onToggleCol?default("false")},
   onChangeSort: ${fisher.onChangeSort?default("false")},
   onSuccess: ${fisher.onSuccess?default("onDoSuccess")},
   onSubmit: ${fisher.onSubmit?default("fisherDefaultOnSubmit")}, // using a custom populate function
   onError:${fisher.onError?default("fisherDefaultOnError")},			
   colModel : [
    <#list fisher.grid.columnList as column >
    //${column.visual} ${fisher.getGrid().getRequest().getParameter("readonly")?default("false")}  ${column.getColumnType()} ${(column.visual=="true"&&((fisher.getGrid().getRequest().getParameter("readonly")?default("false")=="true"&&column.getColumnType()!=3)||(fisher.getGrid().getRequest().getParameter("readonly")?default("false")=="false"&&column.getColumnType()==3)))?string}
      <#if column.visual=="true"&&((fisher.getGrid().getRequest().getParameter("readonly")?default("false")=="true"&&column.getColumnType()!=3)||(fisher.getGrid().getRequest().getParameter("readonly")?default("false")=="false"))>
      	<#assign renderer=column.renderer>
      	<#if column.formatter?default("")=="code"&&column.parameterMap.edittype?default("")==""&&column.parameterMap.editname?default("")=="">
      		<#assign renderer="codeFilterRenderer">
      	</#if>
      	<#if column.formatter?default("")=="type"&&column.parameterMap.edittype?default("")==""&&column.parameterMap.editname?default("")=="">
      		<#assign renderer="typeFilterRenderer">
      	</#if>  
      	<#if column.parameterMap.edittype?default("")!=""&&column.parameterMap.editname?default("")!=""&&fisher.getGrid().getRequest().getParameter("readonly")?default("false")=="false">
      		<#assign renderer="${column.name}FilterRenderer">
      	</#if>        	    	
       {display: '${column.display?js_string}', name : '${column.name?js_string}', width : ${column.width}, sortable : ${column.sortable},  hide: ${column.hide},align: '${column.align?js_string}',process:${renderer} }<#list fisher.grid.columnList as tempcolumn ><#if ( tempcolumn.visual=="true") && ( tempcolumn_index>column_index)  >,<#rt><#break></#if></#list>
      </#if> 
    </#list>
   ],
   <#if fisher.grid.buttonList?size!=0>
   buttons : [
   <#list fisher.grid.buttonList as button >
	   <#if button.buttonType!=2>
	     {name: '${button.name?js_string}', bclass: '${button.styleClass?js_string}',onpress:${button.onclick}} <#if button_has_next>,</#if>
	   </#if>  
	   <#if button.buttonType==2>
	     {separator: true} <#if button_has_next>,</#if>
	    </#if>   
   </#list>							
   ],
   </#if> 
   <#if fisher.quickSearch?default("false")=="true" ><#--有设置快速查询-->
   <#lt>
   searchitems : [
   <#list fisher.grid.columnList as column >
   	 <#if column.quickSearch=="true">
   	  {display: '${column.display?js_string}', name : '${column.name?js_string}'}<#rt>
   	  <#list fisher.grid.columnList as tempcolumn >
   	  	<#if ( tempcolumn.quickSearch=="true") && ( tempcolumn_index>column_index)  >
   	  		,<#lt>
   	  	</#if>
   	  </#list>
   	 </#if>
   </#list>
   ],
   </#if>
   showTableToggleBtn: ${fisher.showTableToggleBtn?default("false")},
   singleSelect: ${fisher.singleSelect?default("false")}
  }
 );
<#--设置当前工程名-->
 fisherContextPath="${contextPath}";
 jQuery(function($) { 
 	 <#--Grid添加配置名称属性，导出数据的时候需要此属性-->
 	 $(".flexigrid").attr("gridName","${fisher.name?default("")?html}");
 	 <#--Grid添加配置列表标题属性，导出数据的时候需要此属性-->
 	 $(".flexigrid").attr("titleName","${fisher.title?default("")?html}");
 	 <#--Grid添加配置导出Url属性，导出数据的时候需要此属性-->
 	 $(".flexigrid").attr("exportUrl","${fisher.getReqeustSearchURL(contextPath+"/fisher/jsp/export.jsp")}");  	 
 	 <#--Grid添加配置动态字段值属性，导出数据的时候需要此属性-->
 	 $(".flexigrid").attr("dynamicColumn","${fisher.dynamicColumn?default("")?html}");
 	 $(".flexigrid").attr("dynamicValue","${fisher.dynamicValue?default("")?html}");
   <#list fisher.grid.buttonList as button >
	   <#--导出按钮-->   
	   <#if button.buttonType==5>
	        <#--Grid添加配置导出按钮导出类型属性，导出数据的时候需要此属性-->
     	 	$(".flexigrid").attr("${button.name}_exportType","${button.type?default("xls")?html}");	   
	        <#--Grid添加配置导出按钮包含字段属性，导出数据的时候需要此属性-->
     	 	$(".flexigrid").attr("${button.name}_includeColumns","${button.includeColumns?default("")?html}");
     	 	<#--Grid添加配置导出按钮排除字段属性，导出数据的时候需要此属性-->
     	 	$(".flexigrid").attr("${button.name}_excludeColumns","${button.excludeColumns?default("operation")?html}");
	   </#if>  
   </#list>	
   <#--自动调整内容高度-->
   fisherResizeHeight(); 	 
 });
</script>	
